import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './router/router'
import store from './store/'
import {routerMode} from './config/env'
import './config/rem'
import FastClick from 'fastclick'
import 'mint-ui/lib/style.css';
import VueScroller from 'vue-scroller'
/*import { Popup } from 'mint-ui';*/
/*import Iview from 'iview';
import 'iview/dist/styles/iview.css';
import "vodal/common.css";
import "vodal/rotate.css";*/
if ('addEventListener' in document) {
  document.addEventListener('DOMContentLoaded', function() {
    FastClick.attach(document.body);
  }, false);
}

Vue.use(VueRouter);
Vue.use(VueScroller);
/*Vue.component(Popup.name, Popup);*/
const router = new VueRouter({
  routes,
  mode: routerMode,
  strict: process.env.NODE_ENV !== 'production',
  scrollBehavior (to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      if (from.meta.keepAlive) {
        from.meta.savedPosition = document.body.scrollTop;
      }
      return { x: 0, y: to.meta.savedPosition ||0}
    }
  }
})


new Vue({
  router,
  store,
}).$mount('#app')

